import {createRouter, createWebHistory} from 'vue-router'
import Navigation from '@/views/Navigation.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Navigation,
      meta: {title: '证照管理', close: true},
    },
    {
      path: '/charts',
      name: 'charts',
      component: () => import('@/views/Charts.vue'),
      meta: {title: '数据看板', back: true, backPath: '/'},
    },
    {
      path: '/filing',
      name: 'filing',
      component: () => import('@/views/Filing.vue'),
      meta: {title: '备案人员', back: true, backPath: '/'},
    },
    {
      path: '/filingDetail',
      name: 'filingDetail',
      component: () => import('@/views/FilingDetail.vue'),
      meta: {title: '备案人员信息', back: true},
    },
    {
      path: '/infos',
      name: 'infos',
      component: () => import('@/views/CertInfos.vue'),
      meta: {title: '证照列表', back: true, backPath: '/'},
    },
    {
      path: '/infosDetail',
      name: 'infosDetail',
      component: () => import('@/views/CertInfosDetail.vue'),
      meta: {title: '证照信息', back: true},
    },
    {
      path: '/borrow',
      name: 'borrow',
      component: () => import('@/views/BorrowRecord.vue'),
      meta: {title: '借用记录', back: true, backPath: '/'},
    },
    {
      path: '/borrowDetail',
      name: 'borrowDetail',
      component: () => import('@/views/BorrowDetail.vue'),
      meta: {title: '借用信息', back: true},
    },
    {
      path: '/borrowSelect',
      name: 'borrowSelect',
      component: () => import('@/views/BorrowSelect.vue'),
      meta: {title: '选择需要借用的证件', back: true, backPath: '/'},
    },
    {
      path: '/borrowSubmit',
      name: 'borrowSubmit',
      component: () => import('@/views/BorrowSubmit.vue'),
      meta: {title: '申请借用', back: true, backPath: '/borrowSelect'},
    },
    {
      path: '/return',
      name: 'return',
      component: () => import('@/views/ReturnRecord.vue'),
      meta: {title: '归还记录', back: true, backPath: '/'},
    },
    {
      path: '/returnDetail',
      name: 'returnDetail',
      component: () => import('@/views/ReturnDetail.vue'),
      meta: {title: '归还信息', back: true},
    },
    {
      path: '/returnSelect',
      name: 'returnSelect',
      component: () => import('@/views/ReturnSelect.vue'),
      meta: {title: '选择需要归还的证件', back: true, backPath: '/'},
    },
    {
      path: '/returnSubmit',
      name: 'returnSubmit',
      component: () => import('@/views/ReturnSubmit.vue'),
      meta: {title: '归还证件', back: true, backPath: '/returnSelect'},
    },
    {
      path: '/transfer',
      name: 'transfer',
      component: () => import('@/views/TransferRecord.vue'),
      meta: {title: '转移记录', back: true, backPath: '/'},
    },
    {
      path: '/transferDetail',
      name: 'transferDetail',
      component: () => import('@/views/TransferDetail.vue'),
      meta: {title: '转移信息', back: true},
    },
    {
      path: '/transferSelect',
      name: 'transferSelect',
      component: () => import('@/views/TransferSelect.vue'),
      meta: {title: '选择要转移的证件', back: true, backPath: '/'},
    },
    {
      path: '/transferSubmit',
      name: 'transferSubmit',
      component: () => import('@/views/TransferSubmit.vue'),
      meta: {title: '选择要转移的证件', back: true, backPath: '/transferSelect'},
    },
    {
      path: '/auditSelect',
      name: 'auditSelect',
      component: () => import('@/views/AuditSelect.vue'),
      meta: {title: '选择要审核的转移记录', back: true, backPath: '/'},
    },
    {
      path: '/auditSubmit',
      name: 'auditSubmit',
      component: () => import('@/views/AuditSubmit.vue'),
      meta: {title: '转移审核', back: true, backPath: '/auditSelect'},
    },
  ],
})

export default router
